<?php

class spMerchandiseDatabase extends spFormDatabase
{
	public function __construct( $id=false )
	{
		parent::__construct( $id );
	}

	// @override
	public function getIdentityTitle()
	{
		return parent::getValue( "title" );
	}
	
	// @override
	static public function getName()
	{
		return "Merchandises";
	}
	
	// @override
	static public function getSqlIdentity()
	{
		return "title";
	}	
	
	// @override
	public function createFormParts()
	{
		$ar = parent::createFormParts();
		return $ar + array(
			"id" => array(array(
				"title"	 	=> "Unique ID",
				"type"		=> "string",
				"readonly"	=> "true",
				"save"		=> "false",
				"sql_col"	=> "id"
			)),		
			"title" => array(array(
				"title"	 	=> "Title",
				"type"		=> "string",
				"sql_col"	=> "title",
				"required"	=> true
			)),
			"description" => array(array(
				"title"		=> "Description",
				"type"		=> "textarea",
				"sql_col"	=> "description"
			)),
			"ordertext" => array(array(
				"title"		=> "Order Text",
				"subtitle"	=> "text shown on the payment window",
				"type"		=> "textarea",
				"sql_col"	=> "ordertext",
				"required"	=> "true"
			)),
			"price" => array(array(
				"title"	 	=> "Price",
				"type"		=> "string",
				"sql_col"	=> "price",
				"required"	=> true
			)),
		);
	}		
}

?>